import {
  createRouter,
  createWebHistory,
  createWebHashHistory,
} from "vue-router";

const routes = [
  {
    path: "/login",
    name: "Login",
    component: () => import("../views/login.vue"),
  },
  {
    path: "/",
    meta: { title: "首页" },
    name: "GallAdminIndex",
    component: () => import("../views/GallAdminIndex.vue"),
    children: [
      {
        path: "/",
        meta: { title: "数据" },
        name: "data",
        component: () => import("../views/data/list.vue"),
      },
      {
        path: "/user",
        meta: { title: "客户" },
        name: "user",
        component: () => import("../views/user/list.vue"),
      },
      {
        path: "/platform",
        meta: { title: "平台" },
        name: "platform",
        component: () => import("../views/platform/list.vue"),
      },
      {
        path: "/goods",
        meta: { title: "平台" },
        name: "goods",
        component: () => import("../views/goods/list.vue"),
      },
    ],
  },
];

const router = createRouter({
  // 引入访问模式
  history: createWebHashHistory(),
  routes,
});

export default router;
